home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 December / CHIPNET Aralık 1997.iso / linux / redhat / misc / src / install / net.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-11  |  1.4 KB  |  46 lines

  1. #ifndef H_NET
  2. #define H_NET
  3.  
  4. #include "bptypes.h"
  5. #include "devices.h"
  6.  
  7. struct netInterface {
  8.     int isConfigured, isUp;
  9.     char dev[10];
  10.     int useBootp;
  11.  
  12.     int isPtp;            /* if true, netmask and broadcast are
  13.                    meaningless and network is the machine
  14.                    on the other side of the link */
  15.  
  16.     /* broadcast and netmask don't really need to be here, but it keeps our
  17.        interface configuration ioctl()'s a bit more generic */
  18.     int32 ip, netmask, broadcast, network;
  19. } ;
  20.  
  21. struct netConfig {
  22.     int isConfigured;
  23.     char hostname[255];
  24.     char domainname[255];
  25.     char * nameserver[3];
  26.     char defaultGateway[255];
  27. } ;
  28.  
  29. int readNetInterfaceConfig(char * prefix, char * device,
  30.                   struct netInterface * intf);
  31. int writeNetInterfaceConfig(char * prefix, struct netInterface * intf);
  32. int writeNetConfig(char * prefix, struct netConfig * netc, 
  33.            struct netInterface * gwdev, int verbose);
  34. int writeResolvConf(char * prefix, struct netConfig * netc);
  35. int writeHosts(char * prefix, struct netConfig * netc, 
  36.            struct netInterface * intf);
  37. int readNetConfig(char * prefix, struct netConfig * netc);
  38. int addDefaultRoute(struct netConfig netc);
  39. int bringUpNetworking(struct netInterface * intf, struct netConfig * netc,
  40.               struct driversLoaded ** dl);
  41. int checkNetConfig(struct netInterface * intf, struct netConfig * netc,
  42.            struct driversLoaded ** dl);
  43. int netDeviceAvailable(char * device);
  44.  
  45. #endif
  46.